package com.informix.stream.api.records;

import com.informix.stream.api.IfmxStreamRecord;
import com.informix.stream.common.enums.IfmxStreamRecordType;
import java.nio.ByteBuffer;

public class IfxCDCBeginTransactionRecord extends IfxCDCRecord implements IfmxStreamRecord {
  private final long time;
  private final int userID;

  public IfxCDCBeginTransactionRecord(byte[] header) {
    super(IfmxStreamRecordType.BEGIN);
    ByteBuffer buffer = ByteBuffer.wrap(header);
    this.sequence = buffer.getLong();
    this.transaction = buffer.getInt();
    this.time = buffer.getLong();
    this.userID = buffer.getInt();
  }

  public int getUserId() {
    return this.userID;
  }

  public long getTime() {
    return this.time;
  }
}
